package com.multidisplay.controller;

import com.multidisplay.bo.InfoBo;
import com.multidisplay.bo.ResultBo;
import com.multidisplay.po.WebPage;
import com.multidisplay.service.impl.WebPageServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WebPageController {
    @Autowired
    private WebPageServiceImpl webPageService;

    @PostMapping("/alterImage")
    public void alterImage(WebPage webPage){
        webPageService.alterImage(webPage);
    }

    @PostMapping("/alterNavBars")
    public void alterNavBars(WebPage webPage){
        webPageService.alterNavBars(webPage);
    }

    @PostMapping("/queryOfFlag")
    public InfoBo<String> queryOfFlag(String flag){
        return webPageService.queryOfFlag(flag);
    }

    @PostMapping("/queryAllWebPage")
    public ResultBo<WebPage> queryAll(int page, int limit){
        return webPageService.queryAll(page, limit);
    }

    @PostMapping("/queryOfResolution")
    public ResultBo<WebPage> queryOfResolution(int page, int limit, String resolution){
        return webPageService.queryOfResolution(page, limit, resolution);
    }

    @PostMapping("/queryOfPid")
    public ResultBo<WebPage> queryOfPid(int page, int limit, String pid){
        return webPageService.queryOfPid(page, limit, pid);
    }
}
